package com.kgc.scd.service;

import com.kgc.scd.bean.ShopUser;
import com.kgc.scd.util.RequestResult;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created On : 2022/11/16.
 * <p>
 * Author : 刘慧枫
 * <p>
 * Description: web端登录业务接口
 */
@FeignClient(value = "wyyxmall-j-l-t-server")
public interface WebShopUserService {

    /**
     * @author : 刘慧枫
     * @date   : 2022/11/16
     * @param  : [userName, userPwd, userPhone, verifyCode, userNickName]
     * @return : com.kgc.scd.util.RequestResult<java.lang.String>
     * @description : 基于feign远程调用wyyxmall-lhf-server服务端 手机号快捷注册
     */
    @PostMapping("/doRegister")
    RequestResult<String> doRegisterUseFeign(@RequestParam("userName") String userName,
                                     @RequestParam("userPwd") String userPwd,
                                     @RequestParam("userPhone") String userPhone,
                                     @RequestParam("verifyCode") String verifyCode,
                                     @RequestParam("userNickName") String userNickName);

    /**
     * @author : 刘慧枫
     * @date   : 2022/11/16
     * @param  : [userName, userPwd]
     * @return : com.kgc.scd.util.RequestResult<java.lang.String>
     * @description : 基于feign远程调用wyyxmall-lhf-server服务端 账号密码登录
     */
    @PostMapping("/login")
    RequestResult<String> doLoginUseFeign(@RequestParam("userName") String userName,@RequestParam("userPwd") String userPwd);

    /**
     * @author : 刘慧枫
     * @date   : 2022/11/16
     * @param  : [userPhone, verifyCode]
     * @return : com.kgc.scd.util.RequestResult<java.lang.String>
     * @description : 基于feign远程调用wyyxmall-lhf-server服务端 手机号快捷登录
     */
    @PostMapping("/doLoginByPhone")
    RequestResult<String> doLoginByPhoneUseFeign(@RequestParam("userPhone") String userPhone,@RequestParam("verifyCode") String verifyCode);

    /**
     * @author : 刘慧枫
     * @date   : 2022/11/16
     * @param  : []
     * @return : com.kgc.scd.util.RequestResult<java.lang.String>
     * @description : 基于feign远程调用wyyxmall-lhf-server服务端 微信扫码登录
     */
    @GetMapping("/wechat/auth/codeUrl")
    RequestResult<String> codeUrlUseFeign();

    /**
     * @author : 刘慧枫
     * @date   : 2022/11/16
     * @param  : [shopUserVO, userPhone, verifyCode]
     * @return : com.kgc.scd.util.RequestResult<java.lang.String>
     * @description : 基于feign远程调用wyyxmall-lhf-server服务端 微信绑定手机号
     */
    @PostMapping("/bindUserPhone")
    RequestResult<String> bindUserPhoneUseFeign(@RequestParam("userPhone") String userPhone, @RequestParam("verifyCode") String verifyCode,@RequestBody ShopUser shopUser);

    /**
     * @author : 刘慧枫
     * @date   : 2022/11/16
     * @param  : [phone]
     * @return : com.kgc.scd.util.RequestResult<java.lang.String>
     * @description : 基于feign远程调用wyyxmall-lhf-server服务端 短信验证码
     */
    @GetMapping("/phone")
    RequestResult<String> sendMessageUseFeign(@RequestParam("phone") String phone);

}
